package org.ihelpuoo.util.cmp;

import java.io.File;
import java.util.Comparator;

public class FileNameLengthComparator implements Comparator<File>
{

	public int compare(File f1, File f2)
	{
		int l2 = f2.getName().length();
		int l1 = f1.getName().length();
		if (l1 == l2)
			return f1.getName().compareTo(f2.getName());
		else if (l1 > l2)
			return 1;
		return -1;
	}

}
